import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
import { PrefabCfg } from '../../../auto/PrefabCfg';
import { Match3ZiUE } from './Match3ZiUE';
const { ccclass, property } = _decorator;

@ccclass('Match3UI')
export class Match3UI extends Component {
    private m_Match3ZiUE_Prefab: Prefab = null;
    async start() {
        console.log(`主玩法界面`)
        this.m_Match3ZiUE_Prefab = await gtr.res.loadAssetAsync(PrefabCfg.Match3ZiUE, Prefab);
        console.log(`增加引用`)
        this.m_Match3ZiUE_Prefab.addRef();

        let ziUE = gtr.ui.instantiate(Match3ZiUE);
        ziUE.node.setParent(this.node);
        ziUE.init();
    }

    onDestroy() {
        this.m_Match3ZiUE_Prefab.decRef(true);
    }
}